﻿// ===============================================================================
// DotNet.Platform 开发框架 2016 版权所有
// ===============================================================================

using System;
using Newtonsoft.Json;

namespace DotNet.EduWebApi.Models
{
    public class LoginResultModel
    {
        public LoginResultModel()
        {
            
        }

        public LoginResultModel(bool success, string message)
        {
            Success = success;
            Message = message;
        }

        public LoginResultModel(bool success, string message, string userId)
        {
            Success = success;
            Message = message;
            Data = new UserData();
            Data.UserId = userId;
        }

        /// <summary>
        /// 是否成功
        /// </summary>
        [JsonProperty("success")]
        public bool Success { get; set; }

        /// <summary>
        /// 状态消息
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; } = string.Empty;

        [JsonProperty("data")]
        public UserData Data { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 培训类型
        /// </summary>
        public string Category { get; set; }

        /// <summary>
        /// IP地址
        /// </summary>
        public string IPAddress { get; set; }

        /// <summary>
        /// 浏览器
        /// </summary>
        public string Browser { get; set; }

        /// <summary>
        /// 设备
        /// </summary>
        public string Device { get; set; }

        /// <summary>
        /// 操作系统
        /// </summary>
        public string OS { get; set; }

        /// <summary>
        /// 登录时间
        /// </summary>
        public DateTime LoginDateTime { get; set; }
    }

    public class UserData
    {
        [JsonProperty("userid")]
        public string UserId { get; set; }
    }
}